package org.runecore.rs2.model.mask;

/**
 * RuneCore
 * Sep 16, 2011
 * @author Harry Andreas<Harry@RuneCore.org>
 */

public class Animation {
	
	/**
	 * Variables for the mask
	 */
	private final int ANIMATION, DELAY;
	
	/**
	 * Creates a new <code>Animation</code>
	 * @param args The arguments for creating the <code>Animation</code>
	 * @return The <code>Animation</code> instance
	 */
	@SuppressWarnings("finally")
	public static Animation create(int... args) {
		switch(args.length) {
		case 1:
			return new Animation(args[0]);
		case 2:
			return new Animation(args[1]);
		default:
			try {
				throw new Exception("Argument length cannot be "+args.length+" for an animation!");
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				return null;
			}
		}
	}
	
	/**
	 * Constructor
	 * @param id The <code>Animation</code> ID
	 */
	private Animation(int id) {
		this.DELAY = -1;
		this.ANIMATION = id;
	}
	
	/**
	 * Constructor
	 * @param id The <code>Animation</code> ID
	 * @param delay The delay for the animation
	 */
	private Animation(int id, int delay) {
		this.DELAY = delay;
		this.ANIMATION = id;
	}

	/**
	 * Getter
	 * @return The <code>Animation</code> ID
	 */
	public int getAnimation() {
		return ANIMATION;
	}

	/**
	 * Getter
	 * @return The <code>Animation</code> delay
	 */
	public int getDelay() {
		return DELAY;
	}

}